<?php
namespace Home\Controller;
use Think\Controller;
class SearchController extends CommonController {
    public function so(){
    	header("Content-type: text/html; charset=utf-8");
    	$word = I('get.w');

    	$words = getWords($word);

    	var_dump($words);


    	$sql  ="select * from question where ";

    	if($words){

    		foreach ($words as $row) {
    			$sql  .=" title like '%".$row['word']."%' or";

    		}

    	}

    	$sql = rtrim($sql,'or');

    	
    	$data = M()->query($sql);

    	var_dump($data);

    	
    }
}
